package com.zkthink.ceres.promotion.dao;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zkthink.base.mapper.SuperMapper;
import com.zkthink.ceres.promotion.dto.SalesPageDTO;
import com.zkthink.ceres.promotion.entity.Sales;
import com.zkthink.ceres.promotion.vo.admin.SalesAdminPageVO;
import com.zkthink.ceres.promotion.vo.admin.SalesPerformanceAdminVO;
import com.zkthink.ceres.promotion.vo.admin.SalesPerformanceDetailAdminVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * Mapper 接口 分销员
 * </p>
 *
 * @author kellen
 * @date 2020-08-22
 */
@Repository
public interface SalesMapper extends SuperMapper<Sales> {

  @SqlParser(filter = true)
  IPage<SalesAdminPageVO> page(IPage page, @Param("param") SalesPageDTO model);


  @SqlParser(filter = true)
  IPage<SalesPerformanceAdminVO> querySalesPerformance(IPage page,
      @Param("param") SalesPageDTO model);

  @SqlParser(filter = true)
  SalesPerformanceDetailAdminVO querySalesPerformanceDetail(@Param("salesId") Long salesId,@Param("tenantCode") String tenantCode);

  @SqlParser(filter = true)
  Integer selectSubordinateSalesCount(@Param("pid")Long pid, @Param("tenantCode")String tenantCode);
}
